import 'package:flutter/material.dart';
import 'package:flutter_animate/loading/loading_page.dart';
import 'package:flutter_animate/shimmer/shimmer_page.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Animate',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: ListView(
          padding: const EdgeInsets.all(20),
          children: [
            TextButton(onPressed: () {
              Navigator.of(context).push(MaterialPageRoute(builder: (_) => const ShimmerPage()));
            },  child: const Text('闪光动画')),
            TextButton(onPressed: () {
              Navigator.of(context).push(MaterialPageRoute(builder: (_) => const LoadingPage()));
            },  child: const Text('加载圆圈')),
          ],
        ),
      ),
    );
  }
}
